<?php

/**
 * CodeSection form base class.
 *
 * @method CodeSection getObject() Returns the current form's model object
 *
 * @package    Amawal Invest
 * @subpackage form
 * @author     Ameen Shoman<amin.shoman@gmail.com>
 */
abstract class BaseCodeSectionForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'            => new sfWidgetFormInputHidden(),
      'department_id' => new sfWidgetFormPropelChoice(array('model' => 'CodeDepartment', 'add_empty' => true)),
      'branch_id'     => new sfWidgetFormPropelChoice(array('model' => 'Branch', 'add_empty' => true)),
    ));

    $this->setValidators(array(
      'id'            => new sfValidatorPropelChoice(array('model' => 'CodeSection', 'column' => 'id', 'required' => false)),
      'department_id' => new sfValidatorPropelChoice(array('model' => 'CodeDepartment', 'column' => 'id', 'required' => false)),
      'branch_id'     => new sfValidatorPropelChoice(array('model' => 'Branch', 'column' => 'id', 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('code_section[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'CodeSection';
  }

  public function getI18nModelName()
  {
    return 'CodeSectionI18n';
  }

  public function getI18nFormClass()
  {
    return 'CodeSectionI18nForm';
  }

}
